﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true"
    CodeBehind="OrderAnswers.aspx.cs" Inherits="Framework.WebmasterTool.Orders.OrderAnswers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#chkAll").live("change", function () {
                if ($(this).is(":checked")) {
                    $(".checkbox").attr("checked", "checked");
                }
                else {
                    $(".checkbox").removeAttr("checked");
                }
            });
            $(".checkbox").live("click", function () {
                var allCheck = true;
                $(".checkbox").each(function () {
                    if (!$(this).is(":checked")) {
                        allCheck = false;
                        return;
                    }
                });
                if (allCheck == true) {
                    $("#chkAll").attr("checked", "checked");
                }
                else {
                    $("#chkAll").removeAttr("checked");
                }
            });
            $("#<%= btnDelete.ClientID %>").live("click", function () {
                var callFrom = $(this);
                jConfirm('Chắc chắn xoá?', 'Digisky Confirm Dialog',
                function (r) {
                    if (r) {
                        __doPostBack(callFrom.attr('name').replace(/_/g, '$'), '');
                    }
                });
                return false;
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="Server">
    Các trả lời đơn đặt hàng
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="Server">
    <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel ID="Panel1" runat="server" Visible="true">
        <div style="margin: 10px; text-align: right;">
            <asp:Button ID="btnBack" runat="server" Text="Quay lại" OnClick="btnBack_Click" />
        </div>
        <div style="margin: 10px;">
            <asp:GridView runat="server" ID="grvOrderAnswers" CssClass="grid" Width="765px" AutoGenerateColumns="False"
                AllowPaging="True" AllowSorting="True" PagerSettings-Mode="NumericFirstLast"
                PageSize="1" OnPageIndexChanging="grvOrderAnswers_PageIndexChanging">
                <Columns>
                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px">
                        <HeaderTemplate>
                            <input id="chkAll" type="checkbox" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <input id="chkSelect" runat="server" class="checkbox" type="checkbox" title='<%# Eval("AnswerID") %>' />
                        </ItemTemplate>
                        <HeaderStyle Width="20px" />
                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tiêu đề" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Center"
                        HeaderStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("AnswerTitle") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Nội dung" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:Label ID="lblContent" runat="server" Text='<%# Eval("AnswerContent") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày đăng" ItemStyle-Width="120" ItemStyle-HorizontalAlign="Center"
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="120">
                        <ItemTemplate>
                            <asp:Label ID="lblAddedDate" runat="server" Text='<%# String.Format("{0:dd/MM/yyyy HH:mm:ss tt}", (DateTime)(Eval("AddedDate")))%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Người đăng" ItemStyle-Width="110" ItemStyle-HorizontalAlign="Center"
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="110">
                        <ItemTemplate>
                            <asp:Label ID="lblAddedBy" runat="server" Text='<%# Eval("AddedBy") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <table align="center" width="765px" border="0" bgcolor="#ffffcc">
                        <tr>
                            <td height="50" align="center">
                                <div align="center" id="EmptyData">
                                    Không có bài trả lời nào.</div>
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:GridView>
            <div style="width: 765px; text-align: left; margin-top: 10px;">
                <asp:Button runat="server" ID="btnDelete" Text="Xoá các mục đã chọn" OnClick="btnDelete_Click" />
            </div>
        </div>
    </asp:Panel>
</asp:Content>
